import request from '@/utils/request'


//从配置中获取业务的地址
import {baseUrlConfig} from '@/config/config'
const basePath = baseUrlConfig.businessBaseUrl
const userCenterUrl = baseUrlConfig.userCenterUrl



//获取分页列表
export const housePageList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/house/find/page',
    method: 'post',
    data
  })
}

//删除
export const houseDeleteRow: (data: any) => Promise<[]> = (data: any) => {
  return request({
    url: basePath + "/house/delete",
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data
  })
}


//下载模板
export const houseModuleDown = () => {
  return request({
    url: basePath + "/house/download",
    responseType: 'blob',
    method: 'post',
  })
}

//导入
export const houseImport = (data: any) => {
  return request({
    url: basePath + '/house/import',
    method: 'post',
    data
  })
}

//导出当前页的数据
export const exportPageList: (data: any) => Promise<[]> = (data: any) => {
  return request({
    url: basePath + '/house/export',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 增加
// @ts-ignore
export const append = (data) => {
  return request({
    url: basePath + '/house/append',
    method: 'post',
    data
  })
}

// 编辑
// @ts-ignore
export const change = (data) => {
  return request({
    url: basePath + '/house/change',
    method: 'post',
    data
  })
}

//获取用户信息
export const getUserInfo = (data: any) => {
  return request({
    url: userCenterUrl + '/user/find',
    method: 'post',
    data
  })
}
